package com.ibeeking.found.cms.api.feign;

import com.ibeeking.found.cms.api.common.dto.*;
import com.ibeeking.found.cms.api.common.query.CampaignLowPriceFeignQuery;
import com.ibeeking.found.cms.api.common.query.CampaignPageListQuery;
import com.ibeeking.found.cms.api.common.query.CouponInfoPageQuery;
import com.ibeeking.found.cms.api.feign.fallback.CmsMarketingBFallbackFactory;
import com.ibeeking.nematos.utils.base.Page;
import com.ibeeking.nematos.utils.result.ResponseResult;
import com.ibeeking.found.cms.api.common.dto.CampaignLowPriceDTO;
import com.ibeeking.found.cms.api.common.dto.CampaignPageDTO;
import com.ibeeking.found.cms.api.common.dto.CouponInfoDTO;
import com.ibeeking.found.cms.api.common.dto.CouponInfoPageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "mall-marketing-b-server", path = "/b", contextId = "cmsMarketingFeignBClient", fallbackFactory = CmsMarketingBFallbackFactory.class, decode404 = true)
public interface CmsMarketingFeignBClient {

    /**
     * 查询活动中的最低价商品规格活动信息
     *
     * @param query
     * @return
     */
    @PostMapping("/campaign/feign/v1/queryGoodsLowPrice")
    ResponseResult<List<CampaignLowPriceDTO>> queryGoodsLowPrice(@RequestBody List<CampaignLowPriceFeignQuery> query);

    /**
     * 通过券id查询券信息
     *
     * @param ids
     * @return
     */
    @PostMapping(value = "/coupon/feign/v1/queryInfoByIds")
    ResponseResult<List<CouponInfoDTO>> queryInfoByIds(@RequestBody List<Long> ids);

    /**
     * 券条件分页查询
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/coupon/feign/v1/couponPageList")
    ResponseResult<Page<CouponInfoPageDTO>> couponPageList(@RequestBody CouponInfoPageQuery query);

    /**
     * 根据活动场景等条件查询活动分页列表
     *
     * @param query
     * @return
     */
    @PostMapping(value = "/campaign/feign/v1/queryCampaignPageList")
    ResponseResult<Page<CampaignPageDTO>> queryCampaignPageList(@RequestBody CampaignPageListQuery query);


}
